﻿using System;
using LayeredArchitectureSample.ViewModel;

namespace LayeredArchitectureSample.ClientBrowser
{
    internal class ApplicationController : IApplicationController
    {
        public void ShowWares(WaresViewModel locationsViewModel)
        {
            if (locationsViewModel == null) throw new ArgumentNullException("locationsViewModel");

            var window = new WaresView(locationsViewModel);

            window.ShowDialog();
        }

        public void ShowNewWareWindow(NewWareViewModel newWareWindowViewModel)
        {
            if (newWareWindowViewModel == null) throw new ArgumentNullException("newWareWindowViewModel");

            var window = new NewWareView(newWareWindowViewModel);

            window.ShowDialog();
        }

        public void ShowLocations(LocationsViewModel locationsViewModel)
        {
            if (locationsViewModel == null) throw new ArgumentNullException("locationsViewModel");

            var window = new LocationsView(locationsViewModel);

            window.ShowDialog();
        }

        public void ShowNewLocationWindow(NewLocationViewModel viewModel)
        {
            if (viewModel == null) throw new ArgumentNullException("viewModel");

            var window = new NewLocationView(viewModel);

            window.ShowDialog();
        }

        public void ShowRoutes(RoutesViewModel viewModel)
        {
            var window = new RoutesView(viewModel);

            window.ShowDialog();
        }

        public void ShowTrips(TripsViewModel viewModel)
        {
            var window = new TripsView(viewModel);

            window.ShowDialog();
        }
    }
}